<?php $this->headTitle($this->__('Registration') . ' » ', Zend_View_Helper_Placeholder_Container_Abstract::PREPEND);?>
<?php $this->headScript()->appendFile($this->baseUrl('application/layouts/scripts/default/js/jquery/jquery.lizardFormAutoValidation.js'));?>

<script type="text/javascript">
//<![CDATA[
    $(function(){
        var form = $('#form').lizardFormAutoValidation();

        $('#showPassword').click(function(){
            form.find('.password').each(function(){
                var $this  = $(this);
                var $clone = $this.clone();

                if ($this.attr('type') == 'password') {
                    $clone.attr('type', 'text');
                } else {
                    $clone.attr('type', 'password');
                }
                $clone.insertAfter(this);
                $this.remove();
                form.init();
            });
        })
    });
//]]>
</script>

<form method="post" action="<?php echo $this->url();?>" id="form" enctype="multipart/form-data">
    <ul id="formContent">
        <li class="item">
            <?php $el = $this->form->getElement('email')?>
            <div class="title"><label><?php echo $this->__('Email');?>:</label></div>
            <div class="field">
                <input type="text"
                       name="<?php echo $el->getName();?>"
                       class="text"
                       value="<?php echo $el->getValue();?>"
                       title="<?php echo $el->getLabel();?>"/>
                <?php if ($errors = $el->getMessages()):?>
                    <ul class="errors">
                        <?php foreach ($errors as $error):?>
                            <li><?php echo $error?></li>
                        <?php endforeach;?>
                    </li>
                <?php endif;?>
            </div>
        </li>
        <li class="item">
            <?php $el = $this->form->getElement('email')?>
            <div class="title"><label><?php echo $this->__('Password');?>:</label></div>
            <div class="field">
                <input type="password"
                       name="password"
                       class="password text"
                       value=""
                       title="<?php echo $el->getLabel();?>"/>
                <a href="javascript:void(0)" id="showPassword"><?php echo $this->__('Show/Hide')?></a>
                <?php if ($errors = $el->getMessages()):?>
                    <ul class="errors">
                        <?php foreach ($errors as $error):?>
                            <li><?php echo $error?></li>
                        <?php endforeach;?>
                    </li>
                <?php endif;?>
            </div>
        </li>
        <li class="item">
            <br />
            <input type="submit" value="<?php echo $this->__('Register Me');?>" class="button"/>
        </li>
    </ul>
</form>